package com.sbm.svc.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sbm.cmd.TestCmd;
import com.sbm.domain.entity.TestEntity;
import com.sbm.domain.model.TestModel;
import com.sbm.domain.repo.TestRepo;
import com.sbm.svc.TestService;

@Service
@Transactional
public class TestServiceImpl implements TestService {
    private final TestRepo testRepo;

    @Autowired
    public TestServiceImpl(TestRepo testRepo) {
        this.testRepo = testRepo;
    }

    @Override
    public TestModel selectPatient(TestCmd cmd) {
        TestEntity entity = new TestEntity();
        entity.setCardNo(cmd.getCardNo());
        return this.testRepo.selectPatient(entity);
    }

    @Override
    public TestModel select() {
        TestEntity entity = new TestEntity();
        entity.setCardNo("0000000110");
        return this.testRepo.selectPatient(entity);
    }
}
